Functions | Variables
ConvertPixelType Namespace Reference

Functions

def decoding_char (ctypes_char_array)
 

Variables

 currentsystem = platform.system()
 
 input_func = raw_input
 
 SDKVersion = MvCamera.MV_CC_GetSDKVersion()
 
 deviceList = MV_CC_DEVICE_INFO_LIST()
 
tuple tlayerType
 
 ret = MvCamera.MV_CC_EnumDevices(tlayerType, deviceList)
 
 mvcc_dev_info = cast(deviceList.pDeviceInfo[i], POINTER(MV_CC_DEVICE_INFO)).contents
 
def strModeName = decoding_char(mvcc_dev_info.SpecialInfo.stGigEInfo.chModelName)
 
def strSerialNumber = decoding_char(mvcc_dev_info.SpecialInfo.stGigEInfo.chSerialNumber)
 
tuple nip1 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0xff000000) >> 24)
 
tuple nip2 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x00ff0000) >> 16)
 
tuple nip3 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x0000ff00) >> 8)
 
tuple nip4 = (mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x000000ff)
 
 nConnectionNum = input_func("please input the number of the device to connect:")
 
 cam = MvCamera()
 
 stDeviceList = cast(deviceList.pDeviceInfo[int(nConnectionNum)], POINTER(MV_CC_DEVICE_INFO)).contents
 
 nPacketSize = cam.MV_CC_GetOptimalPacketSize()
 
 stOutFrame = MV_FRAME_OUT()
 
int nRGBSize = stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight * 3
 
 stConvertParam = MV_CC_PIXEL_CONVERT_PARAM_EX()
 
 nWidth
 
 nHeight
 
 pSrcData
 
 nSrcDataLen
 
 enSrcPixelType
 
 enDstPixelType
 
 pDstBuffer
 
 nDstBufferSize
 
string file_path = "AfterConvert_RGB.raw"
 
 file_open = open(file_path.encode('ascii'), 'wb+')
 
tuple img_buff = (c_ubyte * stConvertParam.nDstLen)()
 

Function Documentation

◆ decoding_char()

def ConvertPixelType.decoding_char (   ctypes_char_array)
Safely decode a string from a ctypes character array.
Compatible with Python 2.x and 3.x, as well as 32-bit and 64-bit environments.

Variable Documentation

◆ currentsystem

currentsystem = platform.system()

◆ input_func

input_func = raw_input

◆ SDKVersion

SDKVersion = MvCamera.MV_CC_GetSDKVersion()

◆ deviceList

deviceList = MV_CC_DEVICE_INFO_LIST()

◆ tlayerType

tuple tlayerType
Initial value:
1 = (MV_GIGE_DEVICE | MV_USB_DEVICE | MV_GENTL_CAMERALINK_DEVICE
2  | MV_GENTL_CXP_DEVICE | MV_GENTL_XOF_DEVICE)

◆ ret

ret = MvCamera.MV_CC_EnumDevices(tlayerType, deviceList)

◆ mvcc_dev_info

mvcc_dev_info = cast(deviceList.pDeviceInfo[i], POINTER(MV_CC_DEVICE_INFO)).contents

◆ strModeName

def strModeName = decoding_char(mvcc_dev_info.SpecialInfo.stGigEInfo.chModelName)

◆ strSerialNumber

def strSerialNumber = decoding_char(mvcc_dev_info.SpecialInfo.stGigEInfo.chSerialNumber)

◆ nip1

tuple nip1 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0xff000000) >> 24)

◆ nip2

tuple nip2 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x00ff0000) >> 16)

◆ nip3

tuple nip3 = ((mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x0000ff00) >> 8)

◆ nip4

tuple nip4 = (mvcc_dev_info.SpecialInfo.stGigEInfo.nCurrentIp & 0x000000ff)

◆ nConnectionNum

nConnectionNum = input_func("please input the number of the device to connect:")

◆ cam

cam = MvCamera()

◆ stDeviceList

stDeviceList = cast(deviceList.pDeviceInfo[int(nConnectionNum)], POINTER(MV_CC_DEVICE_INFO)).contents

◆ nPacketSize

nPacketSize = cam.MV_CC_GetOptimalPacketSize()

◆ stOutFrame

stOutFrame = MV_FRAME_OUT()

◆ nRGBSize

int nRGBSize = stOutFrame.stFrameInfo.nWidth * stOutFrame.stFrameInfo.nHeight * 3

◆ stConvertParam

stConvertParam = MV_CC_PIXEL_CONVERT_PARAM_EX()

◆ nWidth

nWidth

◆ nHeight

nHeight

◆ pSrcData

pSrcData

◆ nSrcDataLen

nSrcDataLen

◆ enSrcPixelType

enSrcPixelType

◆ enDstPixelType

enDstPixelType

◆ pDstBuffer

pDstBuffer

◆ nDstBufferSize

nDstBufferSize

◆ file_path

string file_path = "AfterConvert_RGB.raw"

◆ file_open

file_open = open(file_path.encode('ascii'), 'wb+')

◆ img_buff

tuple img_buff = (c_ubyte * stConvertParam.nDstLen)()